FROM golang:1.17 AS build
WORKDIR /httpserver/
COPY . .
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
#ENV VERSION=0.0.1
RUN go get
RUN GOOS=linux go build -installsuffix cgo -o go-http-server main.go

FROM alpine:latest
COPY --from=build /httpserver/go-http-server /httpserver/go-http-server
EXPOSE 3000
WORKDIR /httpserver/
ENTRYPOINT ["./go-http-server"]
CMD ["-h","0.0.0.0","-p","80"]


